# Contributor: Jake Buchholz <tomalok@gmail.com>
# Maintainer: Jake Buchholz <tomalok@gmail.com>
pkgname=go-md2man
pkgver=2.0.0
pkgrel=1
pkgdesc="Utility to convert markdown to man pages"
options="net chmod-clean"
url="https://github.com/cpuguy83/go-md2man"
arch="all"
license="MIT"
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/cpuguy83/go-md2man/archive/v$pkgver.tar.gz"
builddir="$srcdir/src/github.com/cpuguy83/go-md2man"

build() {
	cd "$srcdir"
	export GOPATH="$PWD"
	mkdir -p $(dirname "$builddir")
	ln -s "$PWD/go-md2man-$pkgver" "$builddir"
	cd $builddir
	CGO_ENABLED=0 go build
}

check() {
	./go-md2man -in go-md2man.1.md -out go-md2man.1
}

package() {
	install -Dsm755 go-md2man "$pkgdir"/usr/bin/go-md2man
	install -Dm644 go-md2man.1 "$pkgdir"/usr/share/man/man1/go-md2man.1
}

sha512sums="22a6c950ca7e386246fadb15f05d0a60437a249df48a7c5f905bc4bd05034cede6318e1158bd2113e97b4fd2d1e838776680a00c6141ac2b3c8795aeee15a39d  go-md2man-2.0.0.tar.gz"
